from django.shortcuts import get_list_or_404
from django.template.library import Library

from user.models import CustomUser

register = Library()

@register.filter
def add_attr(value,classname):
    return value.as_widget(attrs={'class':classname})
@register.simple_tag
def get_user():
    user = get_list_or_404(CustomUser)
    return user